Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return MoltenVK log level string in pMessageIdName field of debug utils callback data #2224

Merged
merged 2 commits into from
May 4, 2024

Conversation

SRSaunders
Copy link
Contributor

@SRSaunders SRSaunders commented May 3, 2024

Fixes #2219.

Previously the pMessageIdName field of debug utils callback data was set to nullptr, i.e. no messageId name. To provide more context and information to the user, we now fill this field with the MoltenVK log level string. This, combined with the pMessage string, shows the severity of the message in textual form, and indicates that it comes from MoltenVK.

Note I have changed the mvkGetReportingLevelString() function declaration to inline - I hope this is appropriate.

Also, after making this change I wonder whether it should also be applied to the debug report callback code, i.e. replace _debugReportCallbackLayerPrefix with mvkGetReportingLevelString() for consistency? I don't want to break anything re automated testing scripts, etc. so I didn't make this change yet. However, I think it's a question worth asking.

Use constexpr instead of inline const.
@billhollings
Copy link
Contributor

Also, after making this change I wonder whether it should also be applied to the debug report callback code, i.e. replace _debugReportCallbackLayerPrefix with mvkGetReportingLevelString() for consistency? I don't want to break anything re automated testing scripts, etc. so I didn't make this change yet. However, I think it's a question worth asking.

Hmmm...I'm not sure. It's kind of arbitrary, but PFN_vkDebugReportCallbackEXT:: pLayerPrefix seems to be about layer identification, so "MoltenVK" seems appropriate to me.

Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this. LGTM.

@billhollings billhollings merged commit f6fc303 into KhronosGroup:main May 4, 2024
6 checks passed
@SRSaunders
Copy link
Contributor Author

SRSaunders commented May 4, 2024

UPDATE: by changing to constexpr, I am now getting a bunch of these for the static library build configs:

ISO C++11 does not allow conversion from string literal to 'char *'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pMessageIdName is always set to nullptr in MVKInstance::debugReportMessage()
2 participants